<template>
  <div class="parActive.vue">
    <div v-if="!$store.state.isbusNewsDitle">
      <div
        class="activ_box"
        v-for="item in sonList"
        :key="item.id"
      >
        <div class="activ_list pointer">
          <p
            class="activ_title"
            @click="handDitle(item)"
          >{{item.title}}</p>
          <p class="activ_time">[{{item.createdTime}}]</p>
        </div>
        <div class="activ_cont">
          {{item.dp}}
        </div>
        <div style="text-align:center;">
          <img
            src="../../../assets/imges/zhixian.png"
            alt=""
          >
        </div>
      </div>
      <div class="page_box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[5,10,15]"
          :page-size="pageBid3.limit"
          layout="total, prev, pager, next, jumper"
          :total="pageBid3.totalCount"
        >
        </el-pagination>
        <!-- <router-view></router-view> -->
      </div>
    </div>
    <transition name="fade">
      <div
        v-if="$store.state.isbusNewsDitle"
        class="busDitle_dog"
      >
        <mydetails
          :sonList="sonList"
          :dateils="dateils"
        >
        </mydetails>
      </div>
    </transition>
  </div>
</template>

<script>
export default {
  name: "parActive.vue",
  props: {
    sonList: {
      type: Array
    },
    count: {
      type: Number
    }
  },
  watch: {
    count(newlIst, olist) {
      this.pageBid3.totalCount = newlIst;
    },
    sonList(newlIst, olist) {
      newlIst.forEach(item => {
        item.img = this.$store.state.baseUrl + item.img;
      });
    }
  },
  data() {
    return {
      pageBid3: {
        start: 1,
        limit: 10,
        totalCount: 0,
        tatalpage: 0
      }
    };
  },
  mounted() {
    if (this.count != 0) {
      this.pageBid3.totalCount = this.count;
    }
  },
  methods: {
    handDitle(item) {
      this.dateils = item;
      this.$store.commit("handBus", true);
    },
    handleSizeChange(val) {
      // this.$parent.handSonNav(this.$parent.activeId, 1, val);
    },
    handleCurrentChange(val) {
      this.$emit("handSonNav", this.$parent.activeId, val, 10);
    }
  }
};
</script>

<style lang='scss' scoped>
.activ_box {
  .activ_list:hover .activ_title,
  .activ_list:hover .activ_time {
    color: #1792cf;
  }
  .activ_cont {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 30px;
    color: #333333;
    margin-left: 12px;
  }
  .activ_list {
    margin-bottom: 29px;
    display: flex;
    justify-content: space-between;
    .activ_title {
      color: #333333;
      font-size: 18px;
    }
    .activ_time {
      color: #808080;
      font-size: 16px;
    }
  }
}
</style>
